package com.steak.spring.event;

import lombok.AllArgsConstructor;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @author 刘牌
 * @Title:
 * @date 2022-06-2322:23
 */
@Component
@AllArgsConstructor
public class OrderService {

    final ApplicationContext applicationContext;

    public String placeOrder(OrderDTO orderDTO){
        applicationContext.publishEvent(new OrderEvent<>(this,orderDTO));
        return "下单成功";
    }
}
